package com.hyjx.framework.component.interfaceservice.interfacelog;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hyjx.framework.common.CommonUtil;
import com.hyjx.framework.component.interfaceservice.dataservice.DataServiceModel;
import com.hyjx.framework.component.interfaceservice.datauser.DataUserModel;
import com.hyjx.framework.orm.dao.Pager;

/**
 * 接口访问日志控制器
 */
@Controller
@RequestMapping("/interfacelog")
public class InterfaceLogController {
	@Resource
	private InterfaceLogService service;
	
	
	@RequestMapping(value = "/gotoList_Log" , method = RequestMethod.GET)
	public String gotoList_Log(HttpServletRequest request){
		return "/framework/interfaceservice/interfacelog/log";
	}
	
	@RequestMapping(value = "/queryList_Log" ,produces = "application/json; charset=utf-8", method = {RequestMethod.GET,RequestMethod.POST})
	@ResponseBody
	public String queryList_Log(AttachLogModel model,HttpServletRequest request){
		
		Pager li=service.queryListLog(model);
		List list=li.getResultList();
		
		return CommonUtil.getPageJsonStr(li);
	}
	/**返回用户列表下拉框*/
	@RequestMapping(value = "/queryuserList" ,produces = "application/json; charset=utf-8", method = {RequestMethod.GET,RequestMethod.POST})
	@ResponseBody
	public String queryuserList(){
		return CommonUtil.getJsonString(service.getUserList());
	}
	/**返回用户列表下拉框*/
	@RequestMapping(value = "/querysrvList" ,produces = "application/json; charset=utf-8", method = {RequestMethod.GET,RequestMethod.POST})
	@ResponseBody
	public String querysrvList(){
		//List<AttachLogModel> list=service.getsrvList();
		return CommonUtil.getJsonString(service.getsrvList());
	}
	/**返回结果下拉框*/
	@RequestMapping(value = "/queryresultList" ,produces = "application/json; charset=utf-8", method = {RequestMethod.GET,RequestMethod.POST})
	@ResponseBody
	public String queryresultList(){
		return CommonUtil.getJsonString(service.getresultList());
	}
}
